package com.example.digitaldiary;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.widget.EditText;


public class LineEditText extends EditText {

	  private Paint mPaint = new Paint();
	  private Paint mVert;

	  public LineEditText(Context paramContext, AttributeSet paramAttributeSet)
	  {
	    super(paramContext, paramAttributeSet);
	    this.mPaint.setStyle(Paint.Style.STROKE);
	    this.mPaint.setARGB(100, 90, 90, 90);
	    this.mVert = new Paint();
	    this.mVert.setStyle(Paint.Style.STROKE);
	    this.mVert.setARGB(100, 90, 90, 90);
	    setPadding(15, 5, 0, 5);
	  }

	  protected void onDraw(Canvas paramCanvas)
	  {
	    int i = getLineCount();
	    Paint localPaint = this.mPaint;
	    int j = getHeight();
	    int k = getLineHeight();
	    int m = j / k;
	    if (i < m)
	      i = m;
	    for (int n = 1; ; n++)
	    {
	      if (n >= i)
	      {
	        paramCanvas.drawLine(10.0F, 0.0F, 10.0F, getBottom(), this.mVert);
	        paramCanvas.drawLine(5.0F, 0.0F, 5.0F, getBottom(), this.mVert);
	        super.onDraw(paramCanvas);
	        return;
	      }
	      int i1 = n * k;
	      paramCanvas.drawLine(getLeft(), i1 + 2, getRight(), i1 + 2, localPaint);
	    }
	  }

}
